-:RDBMS :-
Relational database management system

RDBMS follows E.F.CODDS 12 Rules..

To establish Relations
* Foreign Key
* Primary Key

Q.Why need relation between tables ?
A.Because of Normalization :)

Q. What is Normalization ?
A. Distribute Records in several tables to remove "Redundancy"
a.k.a "To remove duplicate records in one table"

For example we have three tables:-

1) countries
2) users
3) accounts

Q. What relation we can establish in above three tables ?
A.

1) a. country "has many" users
   b. user "belongs to" country

2) a) account "belongs to" user
   b) user "has many" acconuts
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
a) SCHEMA (detail of structure)
   overall structure of database
   DB Name + Table Name + Column Name + Column Datatype + etc..details of structure

b) ATTRIBUTES
   Column Name

c) ENTITY
    Table Name

d) TUPLES
   Value in any row of table
#################################
MYSQL COMMANDS :-

1) DDL (Data Definition language)
   (that perform action on Schema)

   CREATE, DROP, ALTER, RENAME,
   TRUNCATE(empty table)
  ------------------------------
2) DML (Data Manipulation language)
   (perform/relate to tuples )
    SELECT, INSERT, UPDATE, DELETE
  ------------------------------
3) DCL (Data Control language)
   (authenticate to user)
    GRANT, REVOKE
  ------------------------------
4) TCL (Transaction Control language)
   (relate to ACID property)
   COMMIT, ROLLBACK, SAVEPOINT, BEGIN
  -------------------------------
##################################
Q.  What is TRUNCATE ?
A.  TRUNCATE = DROP + CREATE
    DDL        DDL  + DDL
  How truncate works ?
  a) Take temp.. backup of structure of table
  b) "DROP" that table
  c) Re-CREATE that table again with use of step-a
  d) Now table Looks "empty"
  e) There is no other step.
######################################
RULES :
a) "Table Name" should be plural because one table contain more then one record.
b) Use "underscore" as separator between two words for ex:

  country_id :)
  countryId :(

c) First column must be "id" in any table ..for ex:

  id             Column name
  INT            data-type
  AUTO_INCREMENT
  PRIMARY KEY     key

d) Default length of INT is 11.
e) Try to take
   status, added_date, modified_date
   as required in any table.
###################################
CMD = TERMINAL = CONSOLE
Q. How to login on MYSQL with CMD?
A. >mysql -u root -p ENTER
   >Enter Password ****** ENTER
   >mysql NOW U ARE IN MYSQL
###################################

BACKTICK : (`)
always Keep
  >DATABASE NAME
  >TABLE NAME
  >COLUMN Name
in Backtick (`)
###################################
ALWAYS KEEP KEYWORDS IN "CAPS"
TRY TO WRITE QUERY IN SEVERAL LINE
###################################
